Skip to content

Refactor serialization logic and reorganize contracts. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

Fa-BRAIK
Copy link
Contributor

This pull request includes several changes to improve exception handling and code organization in the serialization and deserialization processes. The most important changes include the introduction of new exception methods, modifications to existing exception handling, and updates to namespace and contract usage.

Improvements to exception handling:

Code organization and namespace updates:

  • src/Exceptions/DeserializeException.php: Added new static methods to handle various deserialization errors with specific error codes.
  • src/Exceptions/SerializeException.php: Added new static methods to handle various serialization errors with specific error codes.
  • src/Serializers/ArraySerializer.php, src/Serializers/BackedEnumSerializer.php, src/Serializers/DataSerializer.php: Updated to use the new SerializesArrayOfItems contract and moved the contract to a new namespace. [1] [2] [3] [4] [5]

These changes collectively enhance the clarity and maintainability of the codebase by providing more specific error handling and improving the organization of contracts and namespaces.

Replaced `InvalidRefiner::from` with a more specific `emptyTypeContexts` method, simplifying error handling. Moved `SerializesArrayOfItems` interface to the proper namespace under `Serializers\Contracts`. Adjusted serialization and deserialization error handling with a cleaner and more consistent structure. Updated test coverage paths in configuration.
@Fa-BRAIK Fa-BRAIK added the refactor Code improvments reorganization without changing functionality. label Dec 31, 2024
@Fa-BRAIK Fa-BRAIK merged commit eefb049 into main Dec 31, 2024
3 checks passed
@Fa-BRAIK Fa-BRAIK deleted the refactor/exceptions-usage branch December 31, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code improvments reorganization without changing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant